package cn.edu.zafu.bigdata.x.wgj.f;
import java.util.Scanner;
class InvalidScoreException extends Exception{
    public InvalidScoreException(String message){
        super((message));
    }
}
class ScoreChecker{
    public static void checkScore(int score) throws InvalidAgeException{
        if(score<0||score>100){
            throw new InvalidAgeException("输入的分数无效，分数应在0到100之间。");
        }else {
            System.out.println("分数有效。");
        }
    }
}
public class Mainb {
    public static void main(String[] args){
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入一个分数：");
        int score =scanner.nextInt();
        try{
            ScoreChecker.checkScore(score);
        }catch (InvalidAgeException e){
            System.out.println("捕获到InvalidScoreException异常："+e.getMessage());
        }
        scanner.close();
    }
}
